/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.mldn.demo.object;

/**
 *
 * @author Administrator
 */
class Person{
    
    private String name;
    private int age;

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @Override
    public String toString() {
        return "Person{" + "姓名=" + name + ", 年龄=" + age + '}';
    }

    @Override
    public boolean equals(Object obj) {
        if (this==obj) {
            return true;
        }
        if (!(obj instanceof Person)) {
            return false;
        }
        Person per = (Person) obj;
        if (per.name.equals(this.name) && per.age==this.age) {
            return true;
        }else{
            return false;
        }
    }
    
    
}